import java.util.Arrays;

/**
* @description: 453. 最小操作次数使数组元素相等
* @author hewei
* @date 2022/8/9 14:42
* @version 1.0
*/

public class MinMoves {

    public int minMoves(int[] nums) {
        int min = Arrays.stream(nums).min().getAsInt();
        int ans = 0;
        for (int i = 0; i < nums.length; i++) {
            ans += nums[i] - min;
        }
        return ans;
    }
}
